home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / dtype / cdt.lha / cdt / Install < prev    next >
Text File  |  1995-08-10  |  5KB  |  173 lines

  1. ;
  2. ; $PROJECT: c.datatype
  3. ;
  4. ; $VER: Install 39.3 (07.08.95)
  5. ;
  6. ; by
  7. ;
  8. ; Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  9. ;
  10. ; (C) Copyright 1995
  11. ; All Rights Reserved !
  12. ;
  13. ; $HISTORY:
  14. ;
  15. ; 07.08.95 : 039.003 : now remove section works
  16. ; 09.07.95 : 039.002 : some portions from Marius Gröger (CPU selection)
  17. ; 12.03.95 : 039.001 : initial
  18. ;
  19.  
  20. (set cpu (database "cpu"))
  21.  
  22. (set #datatype "c.datatype")
  23. (set #base 1)
  24. (set #basesuffix ".020")
  25. (set #datatype-desc (cat "C(%|++)-Source"))
  26.  
  27. (set mode
  28.       (askchoice
  29.             (prompt @app-name)
  30.             (help @askchoice-help)
  31.             (choices "Install" "Remove")
  32.       )
  33. )
  34.  
  35. (if mode
  36.           (set pmode "Remove")
  37.           (set pmode "Install")
  38. )
  39.  
  40. ; get classes dir
  41. (set classdir
  42.           (askdir
  43.                      (prompt "Where do the Classes belong")
  44.                      (help @askdir-help)
  45.                      (default "SYS:Classes")
  46.           )
  47. )
  48.  
  49. ; now do install or remove
  50. (if mode
  51.           ; Remove
  52.           (
  53.                      ; Show what we are doing
  54.                      (working "Removing " @app-name)
  55.  
  56.                      ; Remove the non-standard pieces
  57.                      (delete (tackon (tackon classdir "datatypes") #datatype))
  58.                      (run (cat "delete devs:datatypes/" #datatype-desc "#?"))
  59.  
  60.                      ; Don't want to use the confusing "Installation Complete" message
  61.                      ; when what we really did was remove things...
  62.                      (message "The \"" @app-name "\" components "
  63.                                  "that you specified have been successfully removed")
  64.                      (exit (quiet))
  65.           )
  66.  
  67.           ; Install
  68.           (
  69.                      (working "Installing " @app-name)
  70.  
  71.                      (set #dtname (tackon "classes/datatypes" #datatype))
  72.  
  73.                      (if (OR (= cpu "68000") (= cpu "68010")) (set #proc 0))
  74.                      (if (= cpu "68020")                      (set #proc 1))
  75.                      (if (= cpu "68030")                      (set #proc 2))
  76.                      (if (OR (= cpu "68040") (= cpu "68060")) (set #proc 3))
  77.  
  78.                      ; choose cpu type
  79.                      (set #proc
  80.                         (askchoice
  81.                             (prompt (cat "There are different versions of \"" #datatype "\", each one optimized "
  82.                                              "for a specific CPU type. Please select one: "))
  83.                             (choices "MC68000" "MC68020" "MC68030" "MC68040")
  84.                             (help (cat "  Select here the CPU type that is installed in your system. "
  85.                                     "\n\n  Currently, this is a MC" cpu ".\n\n  If you select a certain CPU type "
  86.                                     "in the choice box, the \"" #datatype "\" will run on any CPU which "
  87.                                     "type is higher or equal to the selection. However, it won't "
  88.                                     "run on a system equipped with a lower type.\n\n"
  89.                                     @askchoice-help)
  90.                             )
  91.                             (default #proc)
  92.                         )
  93.                      )
  94.  
  95.                      (if (= 0 #proc) (set #suffix ".000"))
  96.                      (if (= 1 #proc) (set #suffix ".020"))
  97.                      (if (= 2 #proc) (set #suffix ".030"))
  98.                      (if (= 3 #proc) (set #suffix ".040"))
  99.  
  100.                      (if (= #proc #base)
  101.                           (run (cat "copy classes/datatypes/" #datatype #basesuffix " classes/datatypes/" #datatype))
  102.                           ; else
  103.                           (run (cat "misc/spatch -oclasses/datatypes/" #datatype " -pclasses/datatypes/c.datatype" #suffix ".pch classes/datatypes/" #datatype #basesuffix))
  104.                      )
  105.  
  106.                      (copylib
  107.                                 (prompt (cat "Copying the Datatype"))
  108.                                 (help @copylib-help)
  109.                                 (source (cat (tackon "classes/datatypes" #datatype)))
  110.                                 (dest (tackon classdir "Datatypes"))
  111.                                 (confirm)
  112.                      )
  113.                      (delete (tackon "classes/datatypes" #datatype))
  114.  
  115.                      ; Install the descriptors
  116.                      (copyfiles
  117.                                 (prompt "Copying the Descriptors")
  118.                                 (help @copyfiles-help)
  119.                                 (source "devs/datatypes")
  120.                                 (dest "DEVS:DataTypes")
  121.                                 (pattern "#?")
  122.                                 (infos)
  123.                                 (confirm)
  124.                      )
  125.  
  126.                      ; Install prefs file
  127.                      (if     (askbool
  128.                                           (prompt "Install Prefs file ?")
  129.                                           (help @askbool-help)
  130.                                 )
  131.                                 (
  132.                                           (copyfiles
  133.                                                      (help @copyfiles-help)
  134.                                                      (source "envarc/datatypes/c.prefs")
  135.                                                      (dest "EnvArc:DataTypes")
  136.                                           )
  137.                                           (copyfiles
  138.                                                      (help @copyfiles-help)
  139.                                                      (source "envarc/datatypes/c.prefs")
  140.                                                      (dest "Env:DataTypes")
  141.                                           )
  142.                                 )
  143.                      )
  144.  
  145.                      ; install doc file
  146.                      (copyfiles
  147.                                 (prompt "Copying autodoc file")
  148.                                 (help @copyfiles-help)
  149.                                 (source "doc")
  150.                                 (dest "AutoDocs:")
  151.                                 (pattern "#?")
  152.                                 (confirm)
  153.                      )
  154.  
  155.                      ; install AmigaGuide file
  156.                      (copyfiles
  157.                                 (prompt "Copying AmigaGuide file")
  158.                                 (help @copyfiles-help)
  159.                                 (source "help")
  160.                                 (dest "AmigaGuide:")
  161.                                 (pattern "#?")
  162.                                 (confirm)
  163.                      )
  164.  
  165.                      ; Tell the system about the new descriptors
  166.                      (run "C:AddDataTypes Refresh")
  167.  
  168.           )
  169. )
  170.  
  171. (set @default-dest classdir)
  172.  
  173.